Package-level declarations

Types

Link copied to clipboard
@Serializable
data class EmptyPayload(val noop: String = "") : EventPayload

Empty EventPayload used as the default when no extra data is needed.

Link copied to clipboard
@Serializable
data class Event(val id: String, val type: EventType, val payload: EventPayload = EmptyPayload(), val timestamp: Long = Clock.System.now().toEpochMilliseconds(), val eventId: String = Uuid.random().toString())

The wire envelope every SSE / event-bus message rides in.

Link copied to clipboard
interface EventPayload

Marker interface implemented by every payload that travels inside an Event. Polymorphic — concrete subclasses are registered in the project-wide serializer module under EventPayload's class.

Link copied to clipboard

The kind of swarm event being broadcast.

Link copied to clipboard
@Serializable
data class NodeCreatedPayload(val node: Node) : EventPayload

Payload of a CREATED event — the brand-new node, in full.

Link copied to clipboard
@Serializable
data class PinEventPayload(val state: DigitalState) : EventPayload

New pin level after a PIN_CHANGED event.

Link copied to clipboard
@Serializable
data class SnapshotUpdatedEventPayload(val snapshot: Snapshot) : EventPayload

New snapshot captured by a DataPoint.

Link copied to clipboard
@Serializable
data class SourceTriggerPayload(val triggeringSource: NodeIdentity, val nodeAction: NodeAction = NodeAction.EXECUTE, val epoch: Long = 0, val hopTtl: Int = DEFAULT_HOP_TTL) : EventPayload

Identifies the node that just changed and the verb it owns, delivered to every node that lists it as a source with a firing invocationTrigger.

Link copied to clipboard
@Serializable
data class StateChangeEventPayload(val state: NodeState) : EventPayload

New lifecycle state after a STATE_CHANGE event.